<?php

namespace app\common\service\order\order_status\items;

use app\model\CouponOrder;

/**
 * 无效订单
 */
class OrderStatusInvalid extends OrderStatusBase
{
    public static function handle(CouponOrder $couponOrder, $next)
    {
        if (CouponOrder::C_REFUND_STATUS_NO == $couponOrder->refund_status && in_array($couponOrder->status, [CouponOrder::C_STATUS_RECHARGE_FAIL])) {

            return $couponOrder->params['return_status'] = self::getReturnStatus(self::CANCLE, '无效订单');

        }


        return $next($couponOrder);
    }
}